Python Graphics by B.J. Korites
Author:B.J. Korites
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA
5.3 Line Intersecting a Circle
The determination of whether the hit point of a line intersecting the plane of a circle is within the circle is trivial. As shown in Figure 5-13, if the distance from the circle’s center to the hit point is greater than the circle’s radius, it lies outside the circle:
if rh > r NO HIT
Figure 5-13Model for out-of-bounds test for a circle
We won’t bother writing a separate program to demonstrate this. You should be able to do that yourself by modifying Listing 5-1 or Listing 5-3. Simply fill the x[ ],y[ ], and z[ ] lists with the points defining the circle’s perimeter and the line coordinates and modify the functions plotsystem and hitpoint.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Hello! Python by Anthony Briggs(9915)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9778)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8297)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7778)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Windows APT Warfare by Sheng-Hao Ma(6842)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(6571)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(6438)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6413)
Kotlin in Action by Dmitry Jemerov(5062)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4317)
Functional Programming in JavaScript by Mantyla Dan(4038)
Solidity Programming Essentials by Ritesh Modi(4003)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3795)
Unity 3D Game Development by Anthony Davis & Travis Baptiste & Russell Craig & Ryan Stunkel(3739)
The Ultimate iOS Interview Playbook by Avi Tsadok(3713)
